import http from "/@ts/axios";
/**
 * 管理用户密码修改
 * @param data
 * @returns
 */

/**
 * 用户登录
 * @param data
 * @returns
 */
export const login = (data: any) => {
  return http.request({
    url: `/login`,
    method: "POST",
    data,
  });
};

export const getCodeImg = () => {
  return http.request({
    url: `/captchaImage`,
    method: "get",
  });
};

export const getInfo = () => {
  return http.request({
    url: `/getInfo`,
    method: "get",
  });
};

export const logout = () => {
  return http.request({
    url: `/logout`,
    method: "post",
  });
};

// 获取路由
export const getRouters = () => {
  return http.request({
    url: "/getRouters",
    method: "get",
  });
};

// 根据字典类型查询字典数据信息
export function getDicts(data: any) {
  return http.request({
    url: "/system/dict/data/type/" + data,
    method: "get",
  });
}

// 查询字典数据详细
export function getDictsData(dictCode: any) {
  return http.request({
    url: "/system/dict/data/" + dictCode,
    method: "get",
  });
}
